package com.host.dyyl;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import uk.co.senab.photoview.PhotoView;

/**
 * @author
 * @describe
 * @fileName PhotoActivity
 * @date 2018/4/13 11:33
 */
public class PhotoActivity extends Activity {

    private ImageView back_iv;
    private PhotoView photo_pv;
    private String imageUrl;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_photo);
        imageUrl = getIntent().getStringExtra("imageUrl");
        init();
    }

    private void init() {
        back_iv = findViewById(R.id.back_iv);
        back_iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        photo_pv = findViewById(R.id.photo_pv);
        if (!TextUtils.isEmpty(imageUrl)) {
            Glide.with(this).load(imageUrl).into(photo_pv);
        }
    }
}
